package com.algernoon.rpc.springrpc.rmi.burlap;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.algernoon.rpc.springrpc.entity.User;

@RestController
public class BurlapRmiController {

	Logger logger = LoggerFactory.getLogger(BurlapRmiController.class);

	@Autowired
	private IBurlapUserService burlapUserService;

	@GetMapping("/burlap/rmi/user/{id}")
	@ResponseBody
	public User findUserById(@PathVariable Integer id) {
		logger.info("[findUserById] request param id is {}.", id);
		return burlapUserService.findUserById(id);
	}
}
